package com.example.newstop;

import com.example.newstop.util.DisplayUtil;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.util.Log;
import android.view.ViewGroup.LayoutParams;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
import android.view.animation.Animation.AnimationListener;
import android.widget.ImageView;

public class IntroduceActivity extends BaseActivity {

	public static final String TAG = "IntroduceActivity";

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		ImageView iv = new ImageView(this);
		
		int width = DisplayUtil.getWidth(getApplicationContext());
		int height = DisplayUtil.getHeight(getApplicationContext());
		showToast(width+":"+height);
		LayoutParams layoutParams = new LayoutParams(width, height);
		iv.setLayoutParams(layoutParams);
		iv.setBackgroundColor(Color.RED);
		iv.setImageDrawable(getResources().getDrawable(R.drawable.logo));
		setContentView(iv);
		
		AlphaAnimation animation = new AlphaAnimation(0.5f, 1.0f);
		animation.setDuration(200);
		animation.setAnimationListener(new AnimationListener() {
			
			@Override
			public void onAnimationStart(Animation animation) {
				// TODO Auto-generated method stub
				
			}
			
			@Override
			public void onAnimationRepeat(Animation animation) {
				// TODO Auto-generated method stub
				
			}
			
			@Override
			public void onAnimationEnd(Animation animation) {
				// TODO Auto-generated method stub
				Intent intent = new Intent(IntroduceActivity.this,MainActivity.class);
				startActivity(intent);
				IntroduceActivity.this.finish();
			}
		});
		iv.startAnimation(animation);
	}

	
}
